package com.koo.common.base.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 说明：
 *
 * @author: charlin
 * @date: 2022-05-05 14:59
 * @version: 1.0.1
 */
@Data
public class BaseEntity implements Serializable {

    @ExcelIgnore
    @ApiModelProperty(value = "创建时间")
    @TableField(value="create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ColumnWidth(10)
    @ExcelProperty(value = "修改时间")
    //@ExcelProperty(value = "发布时间",index = 3,converter = LocalDateTimeConverter.class)
    @ApiModelProperty(value = "修改时间")
    @TableField(value="update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ExcelIgnore
    @ApiModelProperty(value = "创建人")
    @TableField(value="create_username", fill = FieldFill.INSERT)
    private String createUsername;

    @ExcelIgnore
    @ApiModelProperty(value = "创建人id")
    @TableField(value="create_user_id", fill = FieldFill.INSERT)
    private Long createUserId;

    @ExcelIgnore
    @ApiModelProperty(value = "修改人")
    @TableField(value="update_username", fill = FieldFill.INSERT_UPDATE)
    private String updateUsername;

    @ExcelIgnore
    @ApiModelProperty(value = "修改人id")
    @TableField(value="update_user_id", fill = FieldFill.INSERT_UPDATE)
    private Long updateUserId;

    @ExcelProperty(value = "状态")
    @ApiModelProperty(value = "是否可用 1:是")
    @TableField(value="status", fill = FieldFill.INSERT)
    private Integer status;

    @ExcelIgnore
    @ApiModelProperty(value = "是否删除 1:是")
    @TableLogic
    @TableField(value="is_deleted", fill = FieldFill.INSERT)
    private Integer isDeleted;

    @ColumnWidth(10)
    @ExcelProperty(value = "备注")
    @ApiModelProperty(value = "备注")
    private String remark;

    @ExcelIgnore
    @Version
    @ApiModelProperty(value = "版本")
    private Long version;

}
